<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function Star(color, weight, height) {
            this.color = color;
            this.weight = weight;
            this.height = height;
            this.dianji = function (arr) {
                console.log(arr);
            }
        }
        var btn = new Star('red', '1208', '1080');
        btn.dianji('点击');

        for (var k in btn) {
            console.log(btn[k]);
        }
    </script>
</head>

<body>

</body>

</html>